

********************************************************************************************************
*********************************Are Poor People Poorly Heard?********************************************

*Do-file to replicate the analysis

*Julie Sevenans, Awenig Marié, Christian Breunig, Stefaan Walgrave, Karolin Soontjens, Rens Vliegenthart

*contact: julie.sevenans@uantwerpen.be

********************************************************************************************************

use "Sevenans et al._EJPR_Replication data_Party electorate_Income.dta", clear

*Calculate the absolute distance between a politician's estimation and the preference of the income group
gen Q16b = Q16/100
gen abs_diff = abs(Q16b-agreement_income)*100

*Main paper - Table 3, Model 4 - 5 - 6
xtmixed abs_diff i.income_group i.V2 								if sig==1 || _all: R.party_statement_id || V3:
xtmixed abs_diff i.income_group##i.soc_ec i.V2 						if sig==1 || _all: R.party_statement_id || V3:	
xtmixed abs_diff i.income_group##i.soc_ec LR_CHES sex yofe i.V2 	if sig==1 || _all: R.party_statement_id || V3:
margins, at(soc_ec=(0 1) income_group=(1 2) ) atmeans

*Main paper - Figure 2
set scheme s2mono
mplotoffset,  ///
title("", size(med)) ///
yscale(range(0(5)40)) ylabel(0(5)40) ytitle("Distance (percentage points) between" "politician's estimation and electorate's opinion") ///
xscale(range(-0.5 1.5))  ///
recast(scatter) ///
graphregion(color(white))

*Main paper - Table 3, Model 7
xtmixed abs_diff i.income_group##i.soc_ec##c.LR_CHES sex yofe i.V2 	if sig==1 || _all: R.party_statement_id || V3:
margins, at(soc_ec=(0 1) income_group=(1 2) LR_CHES=(2(6)8)) atmeans

*Main paper - Figure 3
mplotoffset,  ///
bydimension(LR_CHES) byopt(title("") graphregion(color(white))) ///
yscale(range(0(5)40)) ylabel(0(5)40) ytitle("Distance (percentage points) between" "politician's estimation and electorate's opinion") ///
xscale(range(-0.5 1.5))  ///
recast(scatter)

*Main paper - in text - results hold whenever we drop a country from the analysis
xtmixed abs_diff i.income_group##i.soc_ec LR_CHES sex yofe i.V2 	if sig==1 & V2!=1 || _all: R.party_statement_id || V3:
xtmixed abs_diff i.income_group##i.soc_ec LR_CHES sex yofe i.V2 	if sig==1 & V2!=2 || _all: R.party_statement_id || V3:
xtmixed abs_diff i.income_group##i.soc_ec LR_CHES sex yofe i.V2 	if sig==1 & V2!=3 || _all: R.party_statement_id || V3:
xtmixed abs_diff i.income_group##i.soc_ec LR_CHES sex yofe i.V2 	if sig==1 & V2!=5 || _all: R.party_statement_id || V3:
xtmixed abs_diff i.income_group##i.soc_ec LR_CHES sex yofe i.V2 	if sig==1 & V2!=6 || _all: R.party_statement_id || V3:

*Appendix 4 - Table A4.2
xtmixed abs_diff i.income_group i.V2 								|| _all: R.party_statement_id || V3:
xtmixed abs_diff i.income_group##i.soc_ec i.V2 						|| _all: R.party_statement_id || V3:	
xtmixed abs_diff i.income_group##i.soc_ec LR_CHES sex yofe i.V2 	|| _all: R.party_statement_id || V3:
xtmixed abs_diff i.income_group##i.soc_ec##c.LR_CHES sex yofe i.V2 	|| _all: R.party_statement_id || V3:

*Appendix 8 - Table A8.1
xtmixed abs_diff i.income_group i.V2 								if sig==1 & total>=150 || _all: R.party_statement_id || V3:
xtmixed abs_diff i.income_group##i.soc_ec i.V2 						if sig==1 & total>=150 || _all: R.party_statement_id || V3:	
xtmixed abs_diff i.income_group##i.soc_ec LR_CHES sex yofe i.V2 	if sig==1 & total>=150 || _all: R.party_statement_id || V3:
xtmixed abs_diff i.income_group##i.soc_ec##c.LR_CHES sex yofe i.V2 	if sig==1 & total>=150 || _all: R.party_statement_id || V3:

*Appendix 8 - Table A8.2
by V3 SID, sort: egen abs_diff_max = max(abs_diff)
gen dummyDV=1 if abs_diff == abs_diff_max
recode dummyDV (.=0) 
recode dummyDV (1=.) if abs_diff==.

xtmelogit dummyDV i.income_group i.V2 								if sig==1 || _all: R.party_statement_id || V3:
xtmelogit dummyDV i.income_group##i.soc_ec i.V2 					if sig==1 || _all: R.party_statement_id || V3:	
xtmelogit dummyDV i.income_group##i.soc_ec LR_CHES sex yofe i.V2 	if sig==1 || _all: R.party_statement_id || V3:
xtmelogit dummyDV i.income_group##i.soc_ec##c.LR_CHES sex yofe i.V2 	if sig==1 || _all: R.party_statement_id || V3:


use "Sevenans et al._EJPR_Replication data_Party electorate_Class.dta", clear

*Calculate the absolute distance between a politician's estimation and the preference of the class group
gen Q16b = Q16/100
gen abs_diff = abs(Q16b-agreement_class)*100

*Appendix 5 - Table A5.2
xtmixed abs_diff i.class_group i.V2 								if sig==1 || _all: R.party_statement_id || V3:
xtmixed abs_diff i.class_group##i.soc_ec i.V2 						if sig==1 || _all: R.party_statement_id || V3:	
xtmixed abs_diff i.class_group##i.soc_ec LR_CHES sex yofe i.V2 		if sig==1 || _all: R.party_statement_id || V3:
xtmixed abs_diff i.class_group##i.soc_ec##c.LR_CHES sex yofe i.V2 	if sig==1 || _all: R.party_statement_id || V3:

